<script setup>
import { ref } from 'vue';
import ChildCom from './components/ChildCom.vue';

const money = ref(1000)
const car = ref('五菱宏光')

const changeMoney = (count) => {
  // console.log(count)
  money.value -= count
}

</script>

<template>
  <div>
    <!-- 2. 父组件给子组件传值 -->
    <child-com :money="money" :car="car" @change-money="changeMoney" @change-car="car = $event"></child-com>
    <!-- <child-com :money="10000" :car="car"></child-com>
    <child-com :money="10000"></child-com> -->
  </div>
</template>

<style scoped></style>
